//
// Created by 86156 on 25-7-7.
//

#include "gyro.h"
#include <stdint.h>

#include "cmsis_os2.h"
#include "gyro_driver.h"

#include "usart.h"
void JY60_DisConnect_Task() {

}

uint8_t jiaozhun[] = {0xFF, 0xAA, 0x67};
extern osSemaphoreId_t GyroSemBinaryHandle;

void gyro_task(void *argument)
{
    JY60_Init();
    //HAL_UART_Transmit_IT(&huart2, jiaozhun, 3);
    for(;;)
    {
        osStatus_t ret = osSemaphoreAcquire(GyroSemBinaryHandle, 50);//获取信号量
        if (ret == osOK)//osOK：操作成功完成
        {
            JY60_Decode();
            JY60_Init();
        }
        else// 陀螺仪断连
        {
            JY60_DisConnect_Task();
            JY60_Init();
        }
    }
}






